package com.uyaer.wheel.display.scene.el
{
	import com.uyaer.wheel.common.Common;
	import com.uyaer.wheel.res.ResManager;
	
	public class Love extends ElementBase
	{
		private var speedX:Number = -0.5;
		private var speedY:Number = -1;
		public function Love()
		{
			super(ResManager.me.getTextures("home_love"));
			this.stop();
			this.init();
		}
		
		internal override function init():void{
			speedX = Math.random()<0.5?-0.5:0.5;
			speedY = -1;
		}
		
		public override function move():void{
			this.x += speedX;
			this.y += speedY;
			
			if(this.x <=0 || this.x >= Common.W){
				this.reverseSpeed();
			}
		}
		
		private function reverseSpeed():void{
			speedX *= -1;
		}
		
		public override function recycle():void{
			super.recycle();
			ElPool.recycleLove(this);
		}
		
		
	}
}